package com.dangdang.domain;

import java.util.HashSet;
import java.util.Set;

/**
 * 订单实体类
 * 
 * @author Wangpeihu
 * @team [Never give up]
 * @since JDK1.6(建议)
 * @date 2010-1-28
 */

public class Order implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	private Integer id;

	/** 订单所属人 */
	private Integer userId;

	/** 订单状态,0:为发送,1:已发送 */
	private Integer status;

	/** 下单时间 */
	private long orderTime;

	/** 订单描述 */
	private String orderDesc;

	/** 合计金额 */
	private double totalPrice;

	/** 收货人姓名 */
	private String receiveName;

	/** 收货人详细地址 */
	private String fullAddress;

	/** 邮政编码 */
	private String postalCode;

	/** 移动电话 */
	private String mobile;

	/** 固定电话 */
	private String phone;

	/** 该订单所拥有的条目 */
	private Set<Item> items = new HashSet<Item>();

	/** 收获地址 */
	private ReceiveAddress receiveAddress;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public void setOrderTime(long orderTime) {
		this.orderTime = orderTime;
	}

	public String getOrderDesc() {
		return orderDesc;
	}

	public void setOrderDesc(String orderDesc) {
		this.orderDesc = orderDesc;
	}

	public double getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(double totalPrice) {
		this.totalPrice = totalPrice;
	}

	public String getReceiveName() {
		return receiveName;
	}

	public void setReceiveName(String receiveName) {
		this.receiveName = receiveName;
	}

	public String getFullAddress() {
		return fullAddress;
	}

	public void setFullAddress(String fullAddress) {
		this.fullAddress = fullAddress;
	}

	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Set<Item> getItems() {
		return items;
	}

	public void setItems(Set<Item> items) {
		this.items = items;
	}

	public ReceiveAddress getReceiveAddress() {
		return receiveAddress;
	}

	public void setReceiveAddress(ReceiveAddress receiveAddress) {
		this.receiveAddress = receiveAddress;
	}

	/**
	 * 建立关系
	 * 
	 * @param item
	 */
	public void addItem(Item item) {
		items.add(item);
		item.setOrderId(this);
	}

	public long getOrderTime() {
		return orderTime;
	}
}